package spikes

import (
	"context"
	pb "gitee.com/enjoy_5/spikes-rpc/proto/spikes"
)

// 创建秒杀订单
func CreateSpikesOrder(in *pb.CreateSpikesOrderRequest) (resp *pb.CreateSpikesOrderResponse, err error) {
	return resp, client(func(client pb.SpikesServerClient) error {
		resp, err = client.CreateSpikesOrder(context.Background(), in)
		if err != nil {
			return err
		}
		return nil
	})
}

// 删除秒杀订单
func DeleteSpikesOrder(in *pb.DeleteSpikesOrderRequest) (resp *pb.DeleteSpikesOrderResponse, err error) {
	return resp, client(func(client pb.SpikesServerClient) error {
		resp, err = client.DeleteSpikesOrder(context.Background(), in)
		if err != nil {
			return err
		}
		return nil
	})
}
